#include "dominion_helpers.h"
#include "dominion.h"
#include "rngs.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

void myAssert(int a, int b)
{
	if (a != b)
		printf("error\n");
}

int test1()
{
	struct gameState g, t;
	int i, j, p = 4;

	g.numPlayers = p;
	g.whoseTurn = 0;
	g.numBuys = 1;
	for (i = 0; i < p; i++) {
		for (j = 0; j < 5; j++) {
			g.deck[i][j] = gold;
			g.hand[i][j] = silver;
		}
	}
	for (i = 0; i < p; i++) {
		g.deckCount[i] = 5;
		g.handCount[i] = 5;
	}

	memcpy(&t, &g, sizeof(struct gameState));

	cardEffect(council_room, 0, 0, 0, &t, 0, 0);
	
	myAssert(g.handCount[0] += 3, t.handCount[0]);
	myAssert(6, t.handCount[1]);
	myAssert(6, t.handCount[2]);
	myAssert(6, t.handCount[3]);

	return 0;
}

// cardEffect(int card, int choice1, int choice2, int choice3, 
//           struct gameState *state, int handPos, int *bonus)
int main()
{
	printf("Testing cardEffect, case = council_room:\n");
	// Type   = action
	// Effect = +4 cards, +1 buy, each other player draws a card
	// Cost   = 5 coins

	//tests for correct number of cards in each players hand and buys
	test1(); 

	printf("Tests Done\n"); return 0;
}
